using Google.Protobuf;
using Google.Protobuf.Collections;
using Google.Protobuf.Reflection;
using System.Collections.Generic;




public partial class KickOutData : ISerialize 
{

	public static KickOutData NewEntity()
	{
		return new KickOutData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		KickOutData_Data data = CommonFunctions.Deserialize<KickOutData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("KickOutData_Data deserialize failed");
		}
		this.userId = data.UserId;
	}

	public override byte[] Write()
	{
		KickOutData_Data data = new KickOutData_Data();
		data.UserId = this.userId;
		return CommonFunctions.Serialize(data);
	}
}




public partial class FindUserDatabaseData : ISerialize 
{

	public static FindUserDatabaseData NewEntity()
	{
		return new FindUserDatabaseData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		FindUserDatabaseData_Data data = CommonFunctions.Deserialize<FindUserDatabaseData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("FindUserDatabaseData_Data deserialize failed");
		}
		this.username = data.Username;
	}

	public override byte[] Write()
	{
		FindUserDatabaseData_Data data = new FindUserDatabaseData_Data();
		if(username != null)
			data.Username = this.username;
		return CommonFunctions.Serialize(data);
	}
}




public partial class FindUserResponseData  
{

	public static FindUserResponseData NewEntity()
	{
		return new FindUserResponseData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		FindUserResponseData_Data data = CommonFunctions.Deserialize<FindUserResponseData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("FindUserResponseData_Data deserialize failed");
		}
		this.host = data.Host;
		this.code = data.Code;
		this.err = data.Err;
	}

	public override byte[] Write()
	{
		FindUserResponseData_Data data = new FindUserResponseData_Data();
		if(host != null)
			data.Host = this.host;
		data.Code = this.code;
		if(err != null)
			data.Err = this.err;
		return CommonFunctions.Serialize(data);
	}
}




public partial class MaintainData : ISerialize 
{

	public static MaintainData NewEntity()
	{
		return new MaintainData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		MaintainData_Data data = CommonFunctions.Deserialize<MaintainData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("MaintainData_Data deserialize failed");
		}
		this.content = data.Content;
		this.maintainEndTime = data.MaintainEndTime;
	}

	public override byte[] Write()
	{
		MaintainData_Data data = new MaintainData_Data();
		if(content != null)
			data.Content = this.content;
		data.MaintainEndTime = this.maintainEndTime;
		return CommonFunctions.Serialize(data);
	}
}




public partial class CompensateDiamondData : ISerialize 
{

	public static CompensateDiamondData NewEntity()
	{
		return new CompensateDiamondData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		CompensateDiamondData_Data data = CommonFunctions.Deserialize<CompensateDiamondData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("CompensateDiamondData_Data deserialize failed");
		}
		this.diamond = data.Diamond;
		this.date = data.Date;
	}

	public override byte[] Write()
	{
		CompensateDiamondData_Data data = new CompensateDiamondData_Data();
		data.Diamond = this.diamond;
		data.Date = this.date;
		return CommonFunctions.Serialize(data);
	}
}




public partial class WhiteListData : ISerialize 
{

	public static WhiteListData NewEntity()
	{
		return new WhiteListData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		WhiteListData_Data data = CommonFunctions.Deserialize<WhiteListData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("WhiteListData_Data deserialize failed");
		}
		this.whiteList = data.WhiteList.AsList();
	}

	public override byte[] Write()
	{
		WhiteListData_Data data = new WhiteListData_Data();

		foreach (var e in this.whiteList)
			data.WhiteList.Add(e);

		return CommonFunctions.Serialize(data);
	}
}




public partial class StringData : ISerialize 
{

	public static StringData NewEntity()
	{
		return new StringData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		StringData_Data data = CommonFunctions.Deserialize<StringData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("StringData_Data deserialize failed");
		}
		this.value = data.Value;
	}

	public override byte[] Write()
	{
		StringData_Data data = new StringData_Data();
		if(value != null)
			data.Value = this.value;
		return CommonFunctions.Serialize(data);
	}
}




public partial class StringResponseData  
{

	public static StringResponseData NewEntity()
	{
		return new StringResponseData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		StringResponseData_Data data = CommonFunctions.Deserialize<StringResponseData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("StringResponseData_Data deserialize failed");
		}
		this.value = data.Value;
		this.code = data.Code;
		this.err = data.Err;
	}

	public override byte[] Write()
	{
		StringResponseData_Data data = new StringResponseData_Data();
		if(value != null)
			data.Value = this.value;
		data.Code = this.code;
		if(err != null)
			data.Err = this.err;
		return CommonFunctions.Serialize(data);
	}
}


